program Convname;

uses sysutils;

{$R *.RES}




type

 mr=record
  male,female,mnog,primale,prifemale,primnog:array[1..200] of string[12];
  mc,fc,mnc,pmc,pfc,pmnc:word;
 end;

 TNames=object
  m:mr;
  Procedure LoadFromFilesandSaveTo(ss:string);
 end;


Procedure TNames.LoadFromFilesandSaveTo;
var
 f:text;
 s:string;
 ff:file of mr;
begin
 m.mc:=0;m.fc:=0;m.mnc:=0;m.pmc:=0;m.pfc:=0;m.pmnc:=0;
 assignfile(f,'male.dat');
 reset(f);
 repeat
  readln(f,s);
  m.mc:=m.mc+1;
  m.male[m.mc]:=s;
 until eof(f);
 closefile(f);

 assignfile(f,'female.dat');
 reset(f);
 repeat
  readln(f,s);
  m.fc:=m.fc+1;
  m.female[m.fc]:=s;
 until eof(f);
 closefile(f);

 assignfile(f,'mnog.dat');
 reset(f);
 repeat
  readln(f,s);
  m.mnc:=m.mnc+1;
  m.mnog[m.mnc]:=s;
 until eof(f);
 closefile(f);

 assignfile(f,'prilmale.dat');
 reset(f);
 repeat
  readln(f,s);
  m.pmc:=m.pmc+1;
  m.primale[m.pmc]:=s;
 until eof(f);
 closefile(f);

 assignfile(f,'prilfemale.dat');
 reset(f);
 repeat
  readln(f,s);
  m.pfc:=m.pfc+1;
  m.prifemale[m.pfc]:=s;
 until eof(f);
 closefile(f);

 assignfile(f,'prilmnog.dat');
 reset(f);
 repeat
  readln(f,s);
  m.pmnc:=m.pmnc+1;
  m.primnog[m.pmnc]:=s;
 until eof(f);
 closefile(f);
 assignfile(ff,ss);rewrite(ff);write(ff,m);closefile(ff);
end;


var
 n:Tnames;

begin
     n.loadfromfilesandsaveto('rnames.dat');

end.
